#include <iostream>
using std::cout;
using std::endl;

class Base{
public:
    virtual void display() const{
        cout << "Base::display()" << endl;
    }
protected:
    Base(long x)
    : _base(x)
    {}
private:
    long _base;
};


class Derived
: public Base
{
public:
    Derived(long base,long derived)
    : Base(base)//调用基类构造函数
    , _derived(derived)
    {}

    void display() const{
        cout << "Derived::display()" << endl;
    }
private:
    long _derived;
};

void test0(){
    /* Base base(1); */
    Derived d1(2,3);
    Base * pbase = &d1;
    pbase->display();
}

int main(void){
    test0();
    return 0;
}
